import request from '@/utils/request'

// 创建库位
export function createWarehouseLocation(data) {
  return request({
    url: '/wms/warehouse-location/create',
    method: 'post',
    data: data
  })
}

// 更新库位
export function updateWarehouseLocation(data) {
  return request({
    url: '/wms/warehouse-location/update',
    method: 'put',
    data: data
  })
}

// 删除库位
export function deleteWarehouseLocation(id) {
  return request({
    url: '/wms/warehouse-location/delete?id=' + id,
    method: 'delete'
  })
}

// 获得库位
export function getWarehouseLocation(id) {
  return request({
    url: '/wms/warehouse-location/get?id=' + id,
    method: 'get'
  })
}

// 获得库位分页
export function getWarehouseLocationPage(query) {
  return request({
    url: '/wms/warehouse-location/page',
    method: 'get',
    params: query
  })
}

// 获得库位简单列表
export function getWarehouseLocationSimple(areaId) {
  return request({
    url: '/wms/warehouse-location/list-all-simple?areaId=' + areaId,
    method: 'get'
  })
}

// 导出库位 Excel
export function exportWarehouseLocationExcel(query) {
  return request({
    url: '/wms/warehouse-location/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
